

package com.hazelcast.wan;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * Interface for all WAN replication messages
 *
 * @param <T> type of event data
 */
public interface WanEvent<T> {
    /**
     * Returns the service name on which this event occurred.
     *
     * @return the service name on which this event occurred.
     * @see com.hazelcast.map.impl.MapService#SERVICE_NAME
     * @see com.hazelcast.cache.impl.CacheService#SERVICE_NAME
     */
    @Nonnull
    String getServiceName();

    /**
     * Returns the name of the distributed object (map or cache) on which this
     * event occurred.
     *
     * @return the distributed object name
     */
    @Nonnull
    String getObjectName();

    /**
     * Returns the type of this event.
     *
     * @return the WAN event type
     */
    @Nonnull
    WanEventType getEventType();

    /**
     * Returns the event object/data.
     *
     * @return the WAN event object
     */
    @Nullable
    T getEventObject();
}
